<!-- 我的订单item -->
<template>
	<view class="order_item" :class="{'isOpen':!isOpen, 'noPadding':right}">
		<u-checkbox-group v-model="chooseResult" placement="column" class="box" @change="change">
			<view class="items" v-for="(item,index) in dataList" :key="index" @click="$emit('orderItem',item)">
				<view class="createTime" v-if='current==0'>
					<view>下单时间：</view>
					<view>{{item.createTime}}</view>
				</view>
				<view class="item">
					<u-checkbox :key="index" :name="item.id" :checked="item.flag" size="36rpx" shape="circle"
						v-if="isOpen">
					</u-checkbox>
					<view class="center">
						<u--image :src="item.coverImg" width="110px" height="73px" radius='5px'></u--image>
					</view>
					<view class="right">
						<view class="top clamp2">{{item.courseName}}</view>
						<view class="bot">
							<view class="bot_left" v-if='current==0&&item.orderType!==3'>
								讲师: <text>{{item.lecturerName}}</text>
							</view>
							<view class="bot_left" v-if='current==2'>
								<view v-if='item.invoiceFlag==0'>未开票</view>
								<view style="color:#F04848" v-if='item.invoiceFlag==1'>开票中</view>
								<view style="color:#3BB66C" v-if='item.invoiceFlag==2'>已开票</view>
							</view>
							<view class="bot_right">
								<text style="color:#4A4A4A;font-size: 26rpx;">实付款</text>
								<text style="padding-left: 14rpx;">￥</text>
								<view class="money">{{item.payMoney}}</view>
							</view>
						</view>
					</view>
				</view>
			</view>
		</u-checkbox-group>
	</view>
</template>

<script>
	export default {
		props: {
			dataList: {
				type: Array,
				default: () => []
			},
			isOpen: {
				type: Boolean
			},
			//超过3个月的订单
			voidList: {
				type: Array,
				default: () => []
			},
			//超过3个月的订单不需要padding
			right: {
				type: Boolean,
				default: false
			},
			// 已开票状态展示（由tabs标签控制）
			current: {
				type: Number,
				default: 0
			},
			//展示下单时间
			showTime: {
				type: Boolean,
				default: true
			},


		},
		data() {
			return {
				chooseResult: []
			}
		},
		methods: {
			//单挑数据选中
			change(e) {
				this.$emit('changeItem', e)

			},
			// clear() {
			// 	this.chooseResult = [];
			// }
		}
	}
</script>

<style lang="scss" scoped>
	.order_item {
		padding: 0 22rpx 0 20rpx;

		.items {
			background-color: #fff;
			padding: 26rpx 24rpx 26rpx 14rpx;
			margin-top: 24rpx;
			border-radius: 20rpx;
		}

		.item {
			display: flex;
			justify-content: space-between;
			align-items: center;

			.right {
				height: 146rpx;
				width: 374rpx;
				margin-left: 30rpx;
				display: flex;
				flex-direction: column;
				justify-content: space-between;

				.top {
					font-size: 30rpx;
					font-family: Source Han Sans CN;
					font-weight: 500;
					color: #111111;
					line-height: 44rpx;
				}

				.bot {
					font-size: 26rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: #4A4A4A;
					display: flex;
					align-items: baseline;
					justify-content: space-between;

					.bot_left {
                        width: 160rpx;
						overflow: hidden;
						white-space: nowrap;
						text-overflow: ellipsis;
						text {
							color: #7F8185;
							margin-left: 10rpx;
						}
					}

					.bot_right {
						// display: flex;
						// align-items: center;
						// display: flex;
						// align-items: baseline;
						// font-size: 22rpx;
						color: #FFA025;
						font-size: 26rpx;
						font-family: Source Han Sans CN;
						display: flex;
						align-items: baseline;
                        .money{
							font-size: 36rpx;
						}
						&>text{
							font-size: 22rpx;
						}
						// text {
						// 	font-size: 22rpx;
						// 	font-family: PingFang SC;
						// 	font-weight: bold;
						// 	color: #FFA025;
						// 	margin-left: 10rpx;
						// }
					}
				}
			}
		}
	}

	.isOpen {
		padding: 0 30rpx;
	}

	.noPadding {
		padding: 0;
	}

	.createTime {
		display: flex;
		align-items: center;
		font-size: 28rpx;
		color: #B3B3B3;
		padding-bottom: 32rpx;
	}
</style>
